home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / virus / diskse24.zip / DISKSEC2.DOC < prev    next >
Text File  |  1993-12-28  |  22KB  |  441 lines

  1.  
  2.  
  3.                           DISKSECURE II version 2.4
  4.  
  5.  
  6. Hard Disk Protection Program          Copyright (c)1990, 1991, 1993 by 
  7.                       Padgett Peterson
  8.                                       All Rights Reserved
  9.     
  10.  
  11.  
  12.  
  13.  
  14.           I  - Why low-level protection ?
  15.  
  16.          II  - What is DISKSECURE II ?
  17.  
  18.         III  - How is DISKSECURE II Loaded ?
  19.  
  20.          IV  - How is DISKSECURE II Removed ?
  21.  
  22.           V  - Malicious Software (viruses) and DISKSECURE II
  23.  
  24.          VI  - Return Codes
  25.  
  26.         VII  - Licensing - Now FreeWare
  27.  
  28.      Appendix A  - Hidden Sectors/Changing MBR/Changing DBR
  29.  
  30.      Appendix B  - DS2BYP and DS2MOVE
  31.  
  32.      Appendix C  - Other Files
  33.  
  34.                   I - Why Low-Level Protection ?
  35.  
  36.     Today there are many anti-viral software products available
  37. for the IBM-PC (and clones) platform running MS-DOS, OS/2, and UNIX but 
  38. nearly all are invoked following load of the operation system (usually
  39. from CONFIG.SYS or AUTOEXEC.BAT in MS-DOS).  In many cases this is too late
  40. for effective protection from common boot sector infectors (BSI) such as
  41. STONED, MICHELANGELO, or the MUSICBUG.  In the case of the "stealth" 
  42. variants, even state-of-the-art anti-virus routines such as the McAfee 
  43. programs must rely on detection of a viral signature in memory rather than 
  44. detection of infected files.
  45.  
  46.     At the operating system level, too many extra programs have been 
  47. piled upon the basic disk access routines to be able to reliably separate 
  48. the actions of legitimate drivers and TSRs from the activity of malicious 
  49. software.
  50.  
  51.     There is a point at which executable code may be placed that
  52. will always be executed during the boot of a hard disk when the low
  53. level activities have not yet been masked - during the execution of
  54. the Master Boot Record.  At this point the organization of a PC is defined 
  55. according to the IBM BIOS specification. In most cases this structure is
  56. impossible for malicious software to subvert without causing a detectable 
  57. change.  As of August, 1993 there are no known boot sector viruses that 
  58. can bypass detection at this level.
  59.  
  60.     Additionally, there are many access control packages available
  61. that provide strict control and full encryption of systems.  DISKSECURE II
  62. does not attempt to do this, rather it is intended as a simple, unobtrusive
  63. primary access and virus control mechanism that does not require 
  64. administration, and which may be installed/removed/modified with a simple 
  65. menu-driven interface.
  66.  
  67.  
  68.  
  69.                    II - What DISKSECURE II Does
  70.  
  71.     Simply put, DISKSECURE II replaces the Master Boot Record on
  72. a hard disk with its own code.  The necessary elements of the original
  73. partition table are stored on an unused part of the disk and presented 
  74. to the authenticated operating system as required. Unauthorized boot 
  75. programs (such as the BRAIN, STONED, or AZUSA viruses) will not be
  76. able to access the partition table as expected.
  77.  
  78.     DISKSECURE II has multiple elements: three are contained in the file
  79. DISKSEC2.EXE supplied with this document.  The first is an interactive
  80. installation/maintenance/removal module that allows the user to activate,
  81. change, or remove DISKSECURE II from a hard disk. The second is a replacement
  82. for the hard disk partition table that performs load-time checking, prevents
  83. DOS access to the hard disk if booted from a floppy, and contains the 
  84. password access routine if implemented.  The third element is a resident
  85. protection program that takes up 1k of RAM memory and protects the partition
  86. table, hidden sectors, and boot sector of a conventionally partitioned hard 
  87. disk.
  88.  
  89.     To this, DISKSECURE II adds Novell Server compatability, Windows
  90. 3.1 32BitDiskAccess compatability, and the ability to transform itself
  91. from a 1K TSR at the Top of Memory into a 304 byte TSR in low memory (DOS
  92. 3.2 and above only).
  93.  
  94.     Once loaded, DISKSECURE II will prevent access to the fixed disk from
  95. DOS if the resident portion of DISKSECURE II is not in memory.  If password
  96. access has been invoked, this password must be given before DISKSECURE II 
  97. will become resident, allow the OS to load, and before DISKSECURE II can be 
  98. changed or removed.
  99.  
  100.     In the event of accidental booting from an infected floppy disk,
  101. DISKSECURE II adds the ability to automatically detect and disinfect any
  102. virus that does not overwrite the MBR. Such viruses are rare though these 
  103. will render the system unbootable. In this event, the Recovery Disk has two
  104. different means for recovery (use of the DiskSec2.exe and the Dspart.dat
  105. files). 
  106.  
  107.     Recently, a single easily detectable virus has been seen which 
  108. blindly corrupts the Dos Boot Record. DS II will detect these and removal 
  109. is generally a matter of booting through DS II to a floppy and using the 
  110. BYPASS module to SYS the fixed disk. This mechanism should work so long as 
  111. the fixed disk is accessable on a floppy boot (cntrl key depressed).
  112.  
  113.         However, the user must realize that should a boot from an infected
  114. floppy occur before DS II loads, anything could happen and the best that
  115. can be done is to detect that action. See the comments on BIOSes which allow
  116. boot disk selection.
  117.  
  118.     DISKSECURE II adds the capability to boot from a conventional floppy
  119. if the Ctrl key is held down during boot. No special Maintenance floppy is 
  120. needed. This should remove all opposition to setting those BIOSes which
  121. permit it to boot from the fixed disk only. 
  122.  
  123.     Other elements of DISKSECURE II include an automated installation 
  124. program  (DS2INST.BAT) - installation may be dome manually if desired,
  125. a program to verify proper operation of DISKSECURE II (DS2CHK.EXE), a
  126. program to move the DISKSECURE II TSR into low memory (DSMOVE.SYS), and 
  127. a program to allow compatability with incompatable programs (DS2BYP.EXE).
  128.  
  129.  
  130.  
  131.                III - How  DISKSECURE II is Loaded 
  132.  
  133.     The modification program may be loaded either from the fixed
  134. disk or from a separate, bootable floppy (recommended).  It is designed
  135. to recognize if DISKSECURE II is resident, will make many checks to
  136. ensure the integrity of the program, and will warn the user of anything
  137. unusual that it finds.  
  138.  
  139.     If DOS 6.0 or above is in use, it is suggested that DS II be 
  140. installed following a "Bypass Boot" (press F5 during boot so that
  141. CONFIG.SYS and AUTOEXEC.BAT are bypassed)
  142.  
  143.     THE DISKSEC program is invoked by executing from either the DOS 
  144. prompt (automatic installation from other OSs is not yet available) or a
  145. batch (DSINSTALL.BAT) file.  DISKSECURE II will check the number of fixed 
  146. disks present and verify this with the user before proceeding.  Following 
  147. this, DISKSECURE II will require the user to input a password if this 
  148. additional protection is in use before proceeding.  At this point, a 
  149. first-time user will be presented with a warning message before the menu 
  150. is presented.  The user may then select a choice from the menu (the menu 
  151. will change to accommodate the state of DISKSECURE II in the system).
  152.  
  153.     During installation, the user will be asked to save the partition
  154. tables to a file (default: DSPART.COM).  This file should be copied to
  155. a known clean, bootable floppy disk.  If all else fails, the system may be
  156. booted from the floppy, and DSPART executed. Even if the disk is 
  157. unrecognizable by DOS, this will replace the partition table.  WARNING: if 
  158. this file is executed on a machine other than the original or the partition 
  159. table has been changed by repartitioning all data on the disk could be lost.
  160.  
  161.     Where multiple machines are to be protected, it is suggested that
  162. each machine have a unique and identifiable recovery disk and DSPART.DAT
  163. be renamed to identify it with each creating PC. However recovery files
  164. for multiple machines can be stored on a single floppy along with a single
  165. copy of DiskSec2.exe.
  166.  
  167.     Should it be necessary to repartition a disk or the operating
  168. system upgraded, it is necessary that the simple removal procedure be 
  169. followed first as DISKSECURE II will trap any attempt to write to the MBR,
  170. hidden sectors, or the boot record. DS2BYP should not be used for this
  171. function as essential signatures will have changed.
  172.  
  173.     Also provided is the program DS2CHK.EXE.  This will allow the user 
  174. to check if DISKSECURE II is in memory - on activation, nothing will return 
  175. if DISKSECURE II is not active - the DISKSECURE II logo will display if it is 
  176. active.  An errorlevel of (0) will return if DISKSECURE II is not found, 
  177. (1) if DISKSECURE II is resident but not in control (e.g. QEMM 6.0+ "stealth"
  178. in use), and (2) if in memory and in control. DS2CHK.EXE may be invoked
  179. as part of a network login script to verify proper use on a client PC.
  180.  
  181.     The other two major programs included are DS2MOVE.SYS (explained
  182. above) and DS2BYP.EXE. The second should be used with care and only when 
  183. necessary to accomodate programs requiring low level access. See also
  184. Appendix B
  185.  
  186. Note: After activation, if booted from a floppy DOS will not recognize
  187.       the hard disk(s) and, if additional removable media are present,
  188.       DOS may recognize them as the C: drive.  This will not affect
  189.       the operation of DS2CHK.EXE nor will it endanger the data on the
  190.       fixed disk.  If DISKSECURE II is removed, on the next boot the fixed 
  191.       disk(s) will again be recognizable by DOS from a floppy. The disk will 
  192.       always be recognized when booted from a floppy disk through DISKSECURE
  193.       II (by holding the Ctrl key down during boot) so long as DISKSECURE II 
  194.       maintains validity. (if failure occurs, see RECOVERY above).
  195.  
  196.       Use of the DSPART.DAT file as outlined above from a standard DOS
  197.       bootable floppy will recover the disk even if DOS reports the 
  198.       disk unavailable. On the next boot, the drive will be again 
  199.       accessible, however DISKSECURE II will have been removed and must
  200.       be re-installed to restore protection.
  201.  
  202.  
  203.  
  204.            IV - How DISKSECURE II is Removed
  205.  
  206.     In the event that it is necessary to remove DISKSECURE II from a PC,
  207. the best way is to utilize the DiskSec.EXE program either from the
  208. MAINTENANCE floppy, or from the c:\ds directory. When DS is resident, the
  209. program will detect this and modify the menu to include a REMOVE option. 
  210. If a password is in use, it will be necessary to provide this also.
  211.  
  212.     Secondly, the machine can be booted from a regular floppy disk
  213. and the DiskSec2.exe program executed. If a password is in effect this
  214. must be entered for activity.
  215.  
  216.     If the disk should become corrupt, the DSPART.COM program on the
  217. RECOVERY disk may be used for an emergency recovery of the low levels after
  218. which the machine may be rebooted and conventional recovery tools used.
  219. While effective, this should be used only as a "last resort".
  220.  
  221.           V - Malicious Software and DISKSECURE II
  222.  
  223.     DISKSECURE II is a software program.  Consequently, even though it 
  224. is the first software loaded from a fixed disk it CAN be infected or 
  225. damaged , should an indadvertant boot from an infected floppy disk take 
  226. place, even though DOS will not recognize the fixed disk .  Only hardware 
  227. in the form of a ROM extension or custom BIOS can prevent this.  
  228.  
  229.     One effective means with newer BIOSes is to set the CMOS so that
  230. the PC will always boot from the C: drive first. Since DISKSECURE II
  231. allows transfer of a boot to floppy by holding the Ctrl key down during boot,
  232. selection of the A: drive need never be automatic. This combined with
  233. DiskSecure II is effective against every known virus or viral technique
  234. (and a few that haven't been seen yet - don't ask 8*).
  235.  
  236.     What DISKSECURE II can and does do is to recognize immediately 
  237. when it is loaded that an infection has occurred, display an error
  238. message as listed below, and refuse to proceed with the boot process until
  239. corrected (in most case this will be automatic and wait only permission from 
  240. the user. In rare cases, booting from a floppy will be necessary for 
  241. correction however the machine will not boot unless DISKSECURE II's
  242. multiple redundant criteria are met.
  243.  
  244.     Additionally, certain destructive viruses (such as AZUSA) can 
  245. destroy DISKSECURE II. In this event, the disk will be unable to boot and
  246. the drive will be unrecognizable from a floppy. The use of DSPART.DAT,
  247. stored on a bootable floppy, renamed DSPART.COM, and executed will
  248. restore the partition table to a usable condition. In any event, the 
  249. attack will be immediately noticeable and containable.
  250.  
  251. DISKSECURE II boot error messages: see ERROR.MSG file.
  252.  
  253.     Additionally, some malicious software (as well as some low-level
  254. programs) may try to write to DISKSECURE II protected areas on the disk.  In
  255. this case a message may appear on the screen "DISKSECURE II TRAP: x" where x 
  256. indicates the trapped function.  If this should happen during a legitimate 
  257. program, use of DS2BYP will be necessary. This should be done only under
  258. known safe conditions.
  259.  
  260.     A DISKSECURE II trap will occur on an attempt to write to any of the 
  261. "hidden" sectors as well as the first partition's boot sector, or an 
  262. attempt to format any sector on the protected disk(s) (note: many OS format
  263. programs do not actually "format" the disk, only the low-level formatting
  264. such as done by programs that set the interleave of a disk may do this.  (A
  265. MS-DOS 3.3 "FORMAT" will not trigger a DISKSECURE II trap until it is nearly
  266. complete and information may be lost).
  267.  
  268.     Generally, this will only occur if a program attempts to change disk 
  269. interleave, boot record/partitioning, or on complete replacement of the 
  270. operating system (Central Point Software's COMPRESS and Peter Norton's 
  271. SpeedDisk are not affected, Peter Norton's CONFIGUR, MS-DOS FDISK, and
  272. Steve Gibson's SPINRITE are).  
  273.  
  274.     Further, DISKSECURE II has proven safe with all major disk 
  275. compression programs including Stacker, SuperStor Pro, and DblSpace.
  276.  
  277.     DISKSECURE II cannot protect the FATs or Directory structure since 
  278. the user must be able to modify these.  Other programs such as Enigma-
  279. Logic's VIRUS-SAFE, Certus International's CERTUS, Fischer's PC-WATCHDOG, the
  280. McAfee Programs, the Dr.  Panda Utilities, Ross Greenberg's FLUSHOT, and
  281. Fridrik Skulasen's F-PROT exist for this function.  DISKSECURE II was created
  282. to plug a hole that exists under the operating system so that a reasonable
  283. expectation of a clean system can be had when the "C:\>" prompt appears.  
  284.  
  285.  
  286.  
  287.                       VI - Return Codes
  288.  
  289. On termination (if not a reboot) DISKSECURE II returns various error
  290. codes to indicate the reason.  These may be used by a batch file 
  291. for checking/corrective action, however DISKSECURE II is primarily
  292. a manual, interactive program.
  293.  
  294. DISKSEC2.EXE
  295.  
  296. user terminated codes
  297.  
  298. code (hex)
  299.  0   (0)    Program completed with no errors
  300.  1   (1)    Following warning message
  301.  2   (2)    Following TOM/COMPARE message - possible virus
  302.  3   (3)    Following number of fixed disks message
  303.  7   (7)        Following save to file request
  304.  
  305. program terminated codes
  306.  
  307. code (hex)
  308.  8   (8)    No hard disk responding
  309.  9   (9)    Disk access failure
  310. 10   (A)    No active partition table located
  311. 11   (B)    Error in sector one on disk - possible virus
  312. 12   (C)    Active partition table not in proper place - possible virus
  313. 14   (E)        No "Hidden Sectors" on disk (used early version of FDISK).
  314.         or Changing MBR (see actual error message) See Appendix B
  315.  
  316. DS2CHK.EXE
  317.  
  318. 0    (0)    DISKSECURE II not present in memory
  319. 1    (1)        DISKSECURE II present in memory but not in control
  320.                 (low interrupt vector seen only with QEMM 6.0+ "stealth")
  321. 2    (2)        DISKSECURE II present in memory and in control
  322. 4    (4)    DISKSECURE II has been disabled in some other manner
  323. 8    (8)        Disk did not respond (should not occur)
  324.                    VII - Licensing
  325.  
  326.     DISKSECURE II is copyrighted material distributed both as individual
  327. copies and on site/entity licenses. 
  328.  
  329.     With version 2.4, DISKSECURE follows the trend I began with the
  330. FixUtilities of being FreeWare to individuals, however retaining Copyright.
  331. It is not public domain material. It may not be altered in any way or 
  332. distributed except as a complete package (see the DSxx.VAL file for a list 
  333. of contents). 
  334.  
  335.     Customized versions including special switches, logos, encryption,
  336. full partition protection, enforced acceptance, and disclaimers such as:
  337.  
  338.   "Property of the XYZ Corporation & is for Authorized Users Only. 
  339. The right is reserved to monitor any and all transmissions, keystrokes, 
  340.                  and storage on this system." 
  341.  
  342. are available on a site licensing basis.
  343.  
  344. Donations cheerfully accepted 8*) Padgett Peterson
  345.                                   POB 1203
  346.                                   Windermere, Florida, 32819
  347.                                   407.352.6027
  348.  
  349.                  Appendix A - Hidden Sectors / Mutable MBR
  350.  
  351.     While all disk partitioning schemes since the release of PC-DOS
  352. 3.0 in early 1984 have aligned partitions on cylinder boundaries,  very
  353. early disk partitioning programs (e.g.  FDISK 1.00) did not perform this 
  354. alignment.  DISKSECURE II relies on this alignment for installation and 
  355. protection, therefore the installation procedure verifies that no partition 
  356. violates this requirement.
  357.  
  358. Should a disk be found on the system (DISKSECURE II checks all fixed disks),
  359. the installation process will terminate with the warning "No Hidden 
  360. Sectors...".  In this case, it will be necessary to repartition the disk 
  361. using a later version of the partitioning software.
  362.  
  363. Note: It is possible to be running a later version of DOS or other OS
  364.       with a disk partitioned using the early scheme so the DOS "VER"
  365.       command cannot be used to reliably test for this condition.  Peter
  366.       Norton's DI (DiskInfo) and other software will report the number 
  367.       of "hidden sectors" on a disk.  This value should be equal to the
  368.       number of sectors per track.
  369.       
  370.                         Changing MBR
  371.  
  372.      Another condition that DISKSECURE II cannot cope with is that 
  373. a very small number of disk controllers write directly to the MBR at 
  374. intervals. This has only been observed on early XT hard disk units, 
  375. however the integrity of a DISKSECURE IId disk's MBR must be maintained. 
  376. If discovered at load time, the installation process will issue a warning
  377. and the installation will abort. If this should occur during a boot,
  378. the  MATCH ERROR termination will occur and the recovery disk should
  379. be used to restore the disk. Re-installation should not occur until the
  380. cause (viral or otherwise) has been determined.
  381.  
  382.             Changing DBR
  383.  
  384.     Even rarer are the operating systems which write often to the 
  385. DBR but they do exist. Zenith ZDS 3.0, 3.1, and 3.2 plus a few early 
  386. HP Vectras are known to exhibit this behavior. Should periodic "DS II
  387. TRAP: 3" messages occur during the boot process, this may be the cause
  388. since DS II will protect the DBR from writing by any software.
  389.  
  390.         One virus has been seen which on boot from floppy will blindly
  391. write to a common DBR location. If DS II is not running then there is
  392. no means of protection from this. It will be detected on the next full
  393. boot. (see section 2). It is unlikely that this virus will be very
  394. successful.
  395.  
  396.         Appendix B - DS2BYP and DS2MOVE
  397.  
  398.     The two special adjunct files provided with DISKSECURE II have
  399. unique properties that are only functional with versions of DOS of 3.2
  400. or above.
  401.  
  402. DS2MOVE.SYS is the most important as it allows moving of DISKSECURE II
  403.   from a 1k area at the Top of Memory (a 640k machine will report 639k)
  404.   to a 304 byte area of low memory restoring the full 640k to DOS. This
  405.   program is placed in CONFIG.SYS (best if first driver loaded except when
  406.   QEMM DOSDATA driver is in use) and has no switches.
  407.  
  408. DS2BYP.EXE is for use *only* when a program proves completely incompatable
  409.   with DISKSECURE II (such as WIndows 3.1 in 32BitDiskAccess mode). It
  410.   is invoked as follows DS2BYP <drive>:<path><filename.ext>. DS2BYP
  411.   only accepts programs with .COM and .EXE extensions and the drive, path
  412.   and filemname must be fully expanded (no PATH searches or wildcards
  413.   are permitted). Only one program will run on each invocation. This
  414.   rigorous approach is to prevent as far as possible any possibility of a 
  415.   spoof or companion attack. Use with caution.
  416.  
  417.         Appendix C - Other executable and batch files
  418.  
  419. DS2INST.BAT  - a batch file to be used when installing DISKSECURE II
  420.                from a floppy disk. It will create a directory \DS
  421.                on the C: drive, copy the files from the floppy
  422.                into that directory, patch the AUTOEXEC.BAT file
  423.                to include  verification of DISKSECURE II in memory on
  424.                boot (recommended but may be omitted), and invoke
  425.                the main program for installation.
  426.  
  427. DS.B         - Batch file commands to be added to AUTOEXEC.BAT for
  428.                checking referred to in DSINSTAL.BAT
  429.  
  430. ASK.COM      - 10 byte file for making .BATch files interactive. ASK
  431.                will wait for a keystroke and return an errorlevel
  432.                that may be used by an "IF ERRORLEVEL" construct.
  433.  
  434. CHK512.COM   - Short .COM file to identify certain incompatable drives
  435.  
  436. CHKINT13.COM - Short .COM file to verify a "clean" path to the BIOS disk
  437.                access.
  438.  
  439. DOS32.COM    - Short .COM file to verify use of DOS 3.2 or later.
  440.  
  441. QEMMST.COM   - Short .COM file to detect use of QEMM 6.0 & above "stealth"